﻿ /*

 ###########################################################
#                                                           #
#     #  #         #  #                                     #
#     # #    ###   # #   ###      ###   ###    ##   ###     #
#     ##    #   #  ##   #   #    #   # #   #  # #  #   #    #
#     ##    #####  ##   #####       #  #   #    #  #   #    #
#     # #   #      # #  #          #   #   #    #  #   #    #
#     #  #   ###   #  #  ###  # # ####  ###    ###  ###     #
#                                                           #
 ###########################################################
________________________________________________________

 name script: سكربت كشف الهجمات
 Upload date : 14.02.2013 - time: 80:00
 data     : 2013
 name     : fessal
 Nickname : keke..2010
 url      : http://forum.tribalwars.ae/member.php?u=24151
 url      : www.tribalwars.ae
 skype    : keke..2010
 email    : boob-77@hotmail.com
__________________________________________________

Copyright (C) 2013 (keke..2010), all rights reserved
version 1 , 14 February 2013
________________________________________

*/


$(".vis:eq(0) tbody ").prepend("<input id='C' type='submit' value='كامل الجيش'  />");
$(".vis:eq(0) tbody ").prepend("<input id='B' type='submit' value='نفس الجيش'  />");
$(".vis:eq(0) tbody ").prepend("<input id='A' type='submit' value=' إطارات فقط '  />");
$("#A").click(function(){
var k = prompt("أدخل عدد التابات المراد فتحها \n\r","keke..2010"); 
var keke = document.URL.match(/aes\d+/);
var ke = document.URL.match(/village=\d+/);
for(i=0;i<k;i++){ 
window.open('http://'+keke+'.tribalwars.ae/game.php?'+ke+'&screen=place'); 
}
});
$(function(){
$("#B").click(function(){
var ae = document.URL.match(/aes\d+/);
$("#report_list tbody tr").next().each(function(){
var keke = $(this).find("a").attr("href").match(/\d+/g)[1];
var reportURL = $(this).find("a").attr("href");
$.ajax({
url : reportURL,
datatype: "xml",
success : function (data){
var id = $(data).find("#attack_info_att tr:eq(1)").find("a").attr("href").match(/\d+/g)[1];
var attackURL = 'http://'+ae+'.tribalwars.ae/game.php?try=confirm&type=same&report_id='+keke+'&village='+id+'&screen=place'; 
window.open(attackURL );
return false;
}
});
});
});
});
$(function(){
$("#C").click(function(){
var ae = document.URL.match(/aes\d+/);
$("#report_list tbody tr").next().each(function(){
var report = $(this).find("a").attr("href").match(/\d+/g)[1];
var reportURL = $(this).find("a").attr("href");
$.ajax({
url : reportURL,
datatype: "xml",
success : function (data){
var id = $(data).find("#attack_info_att tr:eq(1)").find("a").attr("href").match(/\d+/g)[1];
var attackURL = 'http://'+ae+'.tribalwars.ae/game.php?try=confirm&type=all&report_id='+report+'&village='+id+'&screen=place'; 
window.open(attackURL );
}
});
});
});
});